
#ifndef CENEMY_H
#define CENEMY_H

#include "CBase.h"
#include "Messaging\IListener.h"

struct tVector2D;

enum {ENEMY_HEALTH_BAR, ENEMY_MANA_BAR, ENEMY_BAR_BORDER, ENEMY_SELF, ENEMY_NUM_IMAGE_ENUMS};	// image ID enums

class CEnemy : public CBase, public IListener
{
private:
	bool		m_bIsAlive;			// Is the enemy alive?
	int			m_nHealth;			// the enemy's current health
	int			m_nMaxHealth;		// the enemy's health at maximum
	float		m_fSpeed;			// the enemy's current speed
	float		m_fBaseSpeed;		// the enemy's base speed value
	int			m_nImageID[4];		// the array of all image IDs for this enemy
	int			m_nOwnerType;		// for use in checking what type of character owns a spell
	unsigned int m_unOMGroupID;		// the group that this object should be within the object manager

	IBaseInterface*	m_pTarget;			// the target the enemy chooses to chase
public:
	// constructor
	CEnemy();

	// destructor
	~CEnemy();

	// update the player every frame
	void Update(float fElapsedTime);

	// show up on screen
	void Render(void);

	// set default attributes
	void Reset();

	// check collision against all other objects 
	bool CheckCollision(IBaseInterface* pBase );

	void HandleEvent(CEvent* pEvent);

	// accessors
	bool GetIsAlive()					{ return m_bIsAlive; }
	int  GetHealth()					{ return m_nHealth; }
	int  GetMaxHealth()					{ return m_nMaxHealth; }
	float GetSpeed()					{ return m_fSpeed; }
	float GetBaseSpeed()				{ return m_fBaseSpeed; }
	int GetImageID(int index)			{ return m_nImageID[index]; }
	int  GetOwnerType() const			{ return m_nOwnerType; }
	unsigned int  GetOMGroupID() const	{ return m_unOMGroupID; }
	

	// mutators
	void SetIsAlive(bool isAlive)		{ m_bIsAlive = isAlive; }
	void SetHealth(int nHealth)			{ m_nHealth = nHealth; }
	void SetMaxHealth(int nMaxHealth)	{ m_nMaxHealth = nMaxHealth; }
	void SetSpeed(float speed)			{ m_fSpeed = speed; }
	void SetBaseSpeed(float baseSpeed)	{ m_fBaseSpeed; }
	void SetImageID(int index, int ID)	{ m_nImageID[index] = ID; }
	void SetOwnerType(int ownerType)	{ m_nOwnerType = ownerType; }
	//void SetTarget(IBaseInterface* target)	{ m_pTarget = target->Get; }

	// updates the enemy's position to home in on a target
	void UpdateSeek();
};
#endif